home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / GRAPHICS.SWG / 0083_Textmode Effects.pas < prev    next >
Pascal/Delphi Source File  |  1994-02-18  |  17KB  |  619 lines

  1.  
  2. {Hi Dudes...
  3.  
  4. Dunno if you can do anything with this code; It sure is crappy!
  5. Anywayzz, this kinda looks nice on my computer but I'm not sure
  6. on how the timing will be on other systems... Might cause a
  7. helluvalot of flicker...
  8.  
  9. Well, what can I say? Have Phun 8-)}
  10.  
  11. Program LooksLikeSomeTextModeEffectsToMe_YeahIGuessSo;
  12.  
  13. {$X+,E-,N-,I-,S-,R-,O-}
  14.  
  15. Type BigChar=Array[1..3,1..3] of Byte;
  16.      MoveRecord = Record
  17.                    XPos,YPos : Integer;
  18.                    XSpeed,YSpeed : Integer;
  19.                    Counter : Word;
  20.                   End;
  21.  
  22. Const BigFont : Array[1..40] of BigChar = (
  23.       ((192,196,182),(195,196,191),(188,032,188)), {A}
  24.       ((192,196,182),(195,196,191),(193,196,183)), {B}
  25.       ((192,196,190),(187,032,032),(193,196,190)), {C}
  26.       ((192,190,187),(187,032,187),(193,196,183)), {D}
  27.       ((192,196,190),(195,190,032),(193,196,190)), {E}
  28.       ((192,196,190),(195,190,032),(188,032,032)), {F}
  29.       ((192,196,190),(187,194,182),(193,196,183)), {G}
  30.       ((189,032,189),(195,196,191),(188,032,188)), {H}
  31.       ((194,196,190),(032,187,032),(194,196,190)), {I}
  32.       ((192,196,182),(195,196,191),(188,032,198)), {J}
  33.       ((192,196,182),(195,196,191),(188,032,198)), {K}
  34.       ((189,032,032),(187,032,032),(193,196,190)), {L}
  35.       ((192,196,182),(187,189,187),(188,188,188)), {M}
  36.       ((192,196,182),(187,032,187),(188,032,188)), {N}
  37.       ((192,196,182),(187,032,187),(193,196,183)), {O}
  38.       ((192,196,182),(187,032,187),(187,194,183)), {P}
  39.       ((192,196,182),(195,196,191),(188,032,198)), {Q}
  40.       ((192,196,182),(195,196,198),(188,032,197)), {R}
  41.       ((192,196,190),(193,196,182),(194,196,183)), {S}
  42.       ((194,196,190),(032,187,032),(032,188,032)), {T}
  43.       ((189,032,189),(187,032,187),(193,196,183)), {U}
  44.       ((189,032,187),(188,032,187),(194,196,183)), {V}
  45.       ((189,189,189),(187,188,187),(193,196,183)), {W}
  46.       ((189,032,189),(192,196,183),(188,032,187)), {X}
  47.       ((189,032,189),(193,196,183),(032,188,032)), {Y}
  48.       ((192,196,182),(195,196,191),(188,032,198)), {Z}
  49.       ((032,032,032),(032,032,032),(185,185,185)), {...}
  50.       ((032,187,032),(032,188,032),(032,185,032)), {!}
  51.       ((192,196,182),(187,186,187),(193,196,183)), {0}
  52.       ((194,182,032),(032,187,032),(194,196,190)), {1}
  53.       ((194,196,182),(192,196,183),(193,196,190)), {2}
  54.       ((194,196,182),(032,194,191),(194,196,183)), {3}
  55.       ((189,032,189),(193,196,191),(032,032,188)), {4}
  56.       ((192,196,190),(193,196,182),(194,196,183)), {5}
  57.       ((192,196,190),(195,196,182),(193,196,183)), {6}
  58.       ((194,196,182),(032,032,187),(032,032,188)), {7}
  59.       ((192,196,182),(195,196,191),(193,196,183)), {8}
  60.       ((192,196,182),(193,196,191),(194,196,183)), {9}
  61.       ((032,032,032),(194,196,190),(032,032,032)), {-}
  62.       ((032,032,032),(032,032,032),(032,032,032)));{ }
  63.  
  64.       ScrWidth : Word = 160;
  65.       StartDat : Array[0..15] of Byte = (8,0,1,2,3,4,5,6,7,6,5,4,3,2,1,0);
  66.       BarRes   = 270;
  67.       BarRad   = 260 Div 2;
  68.       Mes      : String = '';
  69.  
  70.       ScrollMessage : String = 'Hi there possoms! howst hanging. How about some simple TextMode Scroller.    ';
  71.       ScrollOfs     : Byte = 9;
  72.       ScrollPos     : Byte = 0;
  73.       CharOfs       : Byte = 2;
  74.  
  75.  
  76. Var BarCols  : Array[0..399] of Byte;
  77.     Bars     : Array[1..4] of Record
  78.                                StartCol : Byte;
  79.                                YPos     : Integer;
  80.                               End;
  81.     BarPos   : Array[1..BarRes] of Integer;
  82.     MyPal    : Array[0..767] of Byte;
  83.     MoveMes,MoveSplit : MoveRecord;
  84.  
  85. Procedure CharMap; Assembler;
  86. Asm
  87.   db      0,0,0,0,0,0,192,240,248,252,252,60,60,60,60,60           {┐}
  88.   db      60,60,60,60,60,252,252,248,240,192,0,0,0,0,0,0           {┘}
  89.   db      24,60,60,60, 60,60,60,60, 60,60,60,24, 0,0,0,0
  90.   db      0,0,0,0, 60,126,255,255, 255,255,126,60, 0,0,0,0
  91.   db      96,240,240,248, 248,120,124,60, 60,62,30,31, 31,15,15,6
  92.   db      60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60
  93.   db      60,60,60,60,60,60,60,60,60,60,60, 24, 0,0,0,0
  94.   db      0,0,0,0, 24,60,60,60,60,60,60,60,60,60,60,60
  95.   db      0,0,0,0,0,0,254,255,255,254,0,0,0,0,0,0           {->}
  96.   db      60,60,60,60,60,124,252,252,252,252,124,60,60,60,60,60
  97.   db      0,0,0,0,0,0,3,15,31,63,62,62,60,60,60,60          {┌}
  98.   db      60,60,60,60,62,62,63,31,15,3,0,0,0,0,0,0          {└}
  99.   db      0,0,0,0,0,0,127,255,255,127,0,0,0,0,0,0           {<-}
  100.   db      60,60,60,60,60,62,63,63, 63,63,62,60, 60,60,60,60 {├}
  101.   db      0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0           {─}
  102.   db      240,120,120,120,120,120,60,60, 60,60,60,24, 0,0,0,0   {\}
  103.   db      60,60,60,60,60,252,252,248,240,224,224,240,240,240,240,240
  104. End;
  105.  
  106. Procedure SetCharset; Assembler;
  107. Asm
  108.  Push Bp
  109.  mov ax,cs                       { Set character set for logo }
  110.  mov es,ax
  111.  mov bp,cs:offset charmap
  112.  mov ax,1100h
  113.  mov bx,1000h
  114.  mov cx,17
  115.  mov dx,182
  116.  int 10h
  117.  Pop Bp
  118. End;
  119.  
  120. Procedure Standard_Palette; Assembler;  { DP ][ Ext. Compatible }
  121. Asm
  122. db 0,0,0,0,0,42,0,42,0,0,42,42,42,0,0,42,0,42,42,21,0,42,42
  123. db 42,21,21,21,21,21,63,21,63,21,21,63,63,63,21,21,63,21,63,63,63,21,63
  124. db 63,63,59,59,59,55,55,55,52,52,52,48,48,48,45,45,45,42,42,42,38,38,38
  125. db 35,35,35,31,31,31,28,28,28,25,25,25,21,21,21,18,18,18,14,14,14,11,11
  126. db 11,8,8,8,63,0,0,59,0,0,56,0,0,53,0,0,50,0,0,47,0,0,44
  127. db 0,0,41,0,0,38,0,0,34,0,0,31,0,0,28,0,0,25,0,0,22,0,0
  128. db 19,0,0,16,0,0,63,54,54,63,46,46,63,39,39,63,31,31,63,23,23,63,16
  129. db 16,63,8,8,63,0,0,63,42,23,63,38,16,63,34,8,63,30,0,57,27,0,51
  130. db 24,0,45,21,0,39,19,0,63,63,54,63,63,46,63,63,39,63,63,31,63,62,23
  131. db 63,61,16,63,61,8,63,61,0,57,54,0,51,49,0,45,43,0,39,39,0,33,33
  132. db 0,28,27,0,22,21,0,16,16,0,52,63,23,49,63,16,45,63,8,40,63,0,36
  133. db 57,0,32,51,0,29,45,0,24,39,0,54,63,54,47,63,46,39,63,39,32,63,31
  134. db 24,63,23,16,63,16,8,63,8,0,63,0,0,63,0,0,59,0,0,56,0,0,53
  135. db 0,1,50,0,1,47,0,1,44,0,1,41,0,1,38,0,1,34,0,1,31,0,1
  136. db 28,0,1,25,0,1,22,0,1,19,0,1,16,0,54,63,63,46,63,63,39,63,63
  137. db 31,63,62,23,63,63,16,63,63,8,63,63,0,63,63,0,57,57,0,51,51,0,45
  138. db 45,0,39,39,0,33,33,0,28,28,0,22,22,0,16,16,23,47,63,16,44,63,8
  139. db 42,63,0,39,63,0,35,57,0,31,51,0,27,45,0,23,39,54,54,63,46,47,63
  140. db 39,39,63,31,32,63,23,24,63,16,16,63,8,9,63,0,1,63,0,0,63,0,0
  141. db 59,0,0,56,0,0,53,0,0,50,0,0,47,0,0,44,0,0,41,0,0,38,0
  142. db 0,34,0,0,31,0,0,28,0,0,25,0,0,22,0,0,19,0,0,16,60,54,63
  143. db 57,46,63,54,39,63,52,31,63,50,23,63,47,16,63,45,8,63,42,0,63,38,0
  144. db 57,32,0,51,29,0,45,24,0,39,20,0,33,17,0,28,13,0,22,10,0,16,63
  145. db 54,63,63,46,63,63,39,63,63,31,63,63,23,63,63,16,63,63,8,63,63,0,63
  146. db 56,0,57,50,0,51,45,0,45,39,0,39,33,0,33,27,0,28,22,0,22,16,0
  147. db 16,63,58,55,63,56,52,63,54,49,63,53,47,63,51,44,63,49,41,63,47,39,63
  148. db 46,36,63,44,32,63,41,28,63,39,24,60,37,23,58,35,22,55,34,21,52,32,20
  149. db 50,31,19,47,30,18,45,28,17,42,26,16,40,25,15,39,24,14,36,23,13,34,22
  150. db 12,32,20,11,29,19,10,27,18,9,23,16,8,21,15,7,18,14,6,16,12,6,14
  151. db 11,5,10,8,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  152. db 0,0,0,0,0,0,49,10,10,49,19,10,49,29,10,49,39,10,49,49,10,39,49
  153. db 10,29,49,10,19,49,10,10,49,12,10,49,23,10,49,34,10,49,45,10,42,49,10
  154. db 31,49,10,20,49,11,10,49,22,10,49,33,10,49,44,10,49,49,10,43,49,10,32
  155. db 49,10,21,49,10,10,63,63,63
  156. End;
  157.  
  158. Function KeyPressed : Boolean; Assembler;
  159. Asm
  160.  Mov Ah,0Bh
  161.  Int 21h
  162. End;
  163.  
  164. Procedure WriteBigMessage(X,Y,Color:Byte; Message:String);
  165. Var B,D    : Byte;
  166.     ScrOfs : Word;
  167.  
  168. Const TransTab : Array[0..255] of Byte =
  169.       (32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, {15}
  170.        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, {31}
  171.        40,28,32,32,32,32,32,32,32,32,32,32,32,39,27,32, {47}
  172.        29,30,31,32,33,34,35,36,37,38,32,32,32,32,32,32, {63}
  173.        32, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, {79}
  174.        16,17,18,19,20,21,22,23,24,25,26,32,32,32,32,32, {95}
  175.        32, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15, {111}
  176.        16,17,18,19,20,21,22,23,24,25,26,32,32,32,32,32, {127}
  177.        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
  178.        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
  179.        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
  180.        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
  181.        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
  182.        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
  183.        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
  184.        32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32);
  185.  
  186. Begin
  187.  Mes:=Message;
  188.  D:=Length(Mes);
  189.  If D=0 then Exit;
  190.  ScrOfs:=(Y-1)*ScrWidth+2*X+2;
  191.  
  192.   Asm
  193.     Mov Ax,$B800              { Set starting address on screen }
  194.     Mov Es,Ax
  195.     Mov Di,ScrOfs
  196.  
  197.     Mov B,1                   { Start with first character ;-) }
  198.    @StringLoop:
  199.     Xor Bh,Bh
  200.     Mov Bl,B
  201.     Mov Al,Ds:[Offset Mes+Bx] { Get Next Character from String }
  202.     Mov Bx,Offset TransTab
  203.     XLat                      { And translate into real value }
  204.  
  205.     Dec Al
  206.     Mov Bl,9
  207.     Mul Bl
  208.     Mov Si,Offset BigFont     { Character offset in Font-Table }
  209.     Add Si,Ax
  210.  
  211.     Mov Ah,Color
  212.     Mov Dx,3
  213.    @FontColumn:               { Loop three Rows... }
  214.     Mov Cx,3
  215.    @FontRow:                  { and three columns }
  216.     LodsB
  217.     StosW
  218.     Loop @FontRow
  219.     Add Di,ScrWidth
  220.     Sub Di,6
  221.     Dec Dx
  222.     Jnz @FontColumn
  223.  
  224.     Mov Ax,3                  { prepare screen address for next character }
  225.     Mul ScrWidth
  226.     Sub Di,Ax
  227.     Add Di,8
  228.  
  229.     Inc B
  230.     Mov Al,D
  231.     Cmp B,Al
  232.     Jng @StringLoop
  233.    End;
  234. End;
  235.  
  236. Procedure WriteCenteredBig(Y,Color:Byte; Message:String);
  237. Begin
  238.  WriteBigMessage(((ScrWidth Div 4)+2)-(Length(Message)*2),Y,Color,Message);
  239. End;
  240.  
  241. Procedure MakePal;
  242. Var A:Word;
  243. Begin
  244.  For A:=0 to 255 do
  245.   Begin
  246.    Mypal[A]:=Mem[Seg(Standard_Palette):Ofs(Standard_Palette)+A*3];
  247.    Mypal[A+256]:=Mem[Seg(Standard_Palette):Ofs(Standard_Palette)+A*3+1];
  248.    Mypal[A+512]:=Mem[Seg(Standard_Palette):Ofs(Standard_Palette)+A*3+2];
  249.   End;
  250. End;
  251.  
  252. Procedure SetupBars;
  253. Var V : Integer;
  254. Begin
  255.   For V:=1 To BarRes Do
  256.    BarPos[V]:=Round(BarRad*Sin((2*Pi/BarRes)*V))+BarRad+1;
  257.  For V:=1 to 4 do
  258.   With Bars[V] do
  259.    Begin
  260.     StartCol:=V*16;
  261.     if v=3 then startcol:=96;
  262.     if v=4 then startcol:=144;
  263.     if v=5 then startcol:=160;
  264.     YPos:=14*V;
  265.    End;
  266.  For V:=304 to 319 do Barcols[V]:=(15-(V mod 16))+160;
  267.  For V:=320 to 335 do Barcols[V]:=V mod 16+160;
  268. End;
  269.  
  270. Procedure UpdateBars;
  271. Var V,U,Y : Integer;
  272. Begin
  273.   For V:=1 To 4 do
  274.    For U:=0 to 31 do BarCols[barpos[Bars[V].YPos]+U]:=0;
  275.  For V:=1 To 4 do
  276.   Begin
  277.    Inc(Bars[V].YPos);
  278.     If Bars[V].YPos>BarRes then Bars[V].YPos:=1;
  279.    Y:=BarPos[Bars[V].YPos];
  280.    For U:=0 to 15 do BarCols[Y+U]:=Bars[V].StartCol+15-U;
  281.    For U:=16 to 31 do BarCols[Y+U]:=Bars[V].StartCol+U-16;
  282.   End;
  283. End;
  284.  
  285. Procedure ColorBars; Assembler;
  286. Asm
  287.   MOV DX,$03DA
  288.   In AL,DX
  289.   MOV DX,$03C0   { assume color nr 0 = default Text background.. }
  290.   MOV AL,$20+0   { set color nr 0 .. }
  291.   OUT DX,AL
  292.   MOV AL,0       { .. to DAC color 0 }
  293.   OUT DX,AL
  294.  
  295.   Xor SI,SI
  296.   CLI
  297.   MOV DX,$03DA
  298.   MOV AH,8
  299. @Wau: in AL,DX
  300.   TEST AL,AH
  301.   JNZ @Wau       { wait Until out of retrace }
  302. @Wai: in AL,DX
  303.   TEST AL,AH
  304.   JZ @Wai        { wait Until inside retrace }
  305. @Doline:
  306.   STI
  307.   Mov Bl,[Offset BarCols+Si]
  308.   Mov Di,Offset MyPal
  309.   Add Di,Bx
  310.  
  311.   MOV DX,$03C8  { point to DAC[0] }
  312.   MOV AL,0
  313.   OUT DX,AL
  314.  
  315.   CLI
  316.   MOV DX,$03DA
  317. @Whu: in AL,DX
  318.   RCR AL,1
  319.   JC @Whu       { wait Until out of horizontal retrace }
  320. @Whi: in AL,DX
  321.   RCR AL,1
  322.   JNC @Whi      { wait Until inside retrace }
  323.  
  324.   Inc Si        { line counter }
  325.                 { prepare For color effect }
  326.  
  327.   MOV DX,$03C9
  328.   Mov Al,[Di]
  329.   OUT DX,Al   { Dynamic Red }
  330.   Mov Al,[Di+256]
  331.   OUT DX,AL   { Dynamic Green }
  332.   mov Al,[Di+512]
  333.   OUT DX,AL   { Dynamic Blue }
  334.  
  335.   CMP SI,296  { Paint just about 3/4 screen }
  336.   JBE  @doline
  337.   STI
  338. End;
  339.  
  340. PROCEDURE Split(Row:Integer);
  341. BEGIN
  342.      ASM
  343.         mov dx,$3d4
  344.         mov ax,row
  345.         mov bh,ah
  346.         mov bl,ah
  347.         and bx,201h
  348.         mov cl,4
  349.         shl bx,cl
  350.         mov ah,al
  351.         mov al,18h
  352.         out dx,ax
  353.         mov al,7
  354.         cli
  355.         out dx,al
  356.         inc dx
  357.         in al,dx
  358.         sti
  359.         dec dx
  360.         mov ah,al
  361.         and ah,0efh
  362.         or ah,bl
  363.         mov al,7
  364.         out dx,ax
  365.         mov al,9
  366.         cli
  367.         out dx,al
  368.         inc dx
  369.         in al,dx
  370.         sti
  371.         dec dx
  372.         mov ah,al
  373.         and ah,0bfh
  374.         shl bh,1
  375.         shl bh,1
  376.         or ah,bh
  377.         mov al,9
  378.         out dx,ax
  379.      END;
  380. END;
  381.  
  382. Procedure FastWrite(Col,Row,Attrib:Byte; Str:String);
  383. Var MemPos : Word;
  384.     A      : Byte;
  385. Begin
  386.  MemPos:=(Col*2)+(Row*ScrWidth)-ScrWidth-2;
  387.  A:=Length(Str);
  388.   For A:=1 to Length(Str) do
  389.    Begin
  390.     MemW[$B800:MemPos]:=Ord(Str[A])+Attrib*256;
  391.     MemPos:=MemPos+2;
  392.    End;
  393. End;
  394.  
  395. Procedure CenterWrite(Y,Color:Byte;Mes:String);
  396. Begin
  397.  FastWrite(41-((Length(Mes)-1) Div 2),Y,Color,Mes);
  398. End;
  399.  
  400. Procedure CursorOff; Assembler;
  401. Asm
  402.   Mov Ax,0100h
  403.   Mov Cx,2000h
  404.   Int 10h
  405. End;
  406.  
  407. Procedure CursorOn; Assembler;
  408. Asm
  409.   Mov Ax,0100h
  410.   Mov Cx,0607h
  411.   Int 10h
  412. End;
  413.  
  414. Procedure ScrollText(Nr:Word); Assembler;
  415. Asm
  416.   mov ax,nr
  417.   mov cx,$40
  418.   mov es,cx
  419.   mov cl,es:[$85]
  420.   div cl
  421.   mov cx,ax
  422.   mov dx,es:[$63]
  423.   push dx
  424.   mov al,$13
  425.   cli
  426.   out dx,al
  427.   inc dx
  428.   in al,dx
  429.   sti
  430.   mul cl
  431.   shl ax,1
  432.   mov es:[$4e],ax
  433.   pop dx
  434.   mov cl,al
  435.   mov al,$c
  436.   out dx,ax
  437.   mov al,$d
  438.   mov ah,cl
  439.   out dx,ax
  440.   mov ah,ch
  441.   mov al,8
  442.   out dx,ax
  443. End;
  444.  
  445.  
  446. Function ReadKey : Char; Assembler;
  447. Asm
  448.  Mov Ah,07h
  449.  Int 21h
  450. End;
  451.  
  452. Procedure SetHorizOfs(Count:Byte);
  453. Var I : Byte;
  454. Begin
  455.  I:=Port[$3DA];
  456.  Port[$3C0]:=$33;
  457.  Port[$3C0]:=StartDat[Count Mod 16];
  458. End;
  459.  
  460. Procedure Sync; Assembler;
  461. Asm
  462.   Mov Dx,3DAh
  463. @LoopIt:
  464.   In Al,Dx
  465.   Test Al,8
  466.   Jz @LoopIt
  467. End;
  468.  
  469. Procedure DoubleWidth; Assembler;
  470. Asm
  471.  Mov Dx,3D4h
  472.  Mov Ax,5013h
  473.  Out Dx,Ax
  474.  Mov ScrWidth,320
  475. End;
  476.  
  477. Procedure SetPELReset; Assembler;
  478. Asm
  479.  Mov Dx,3DAh
  480.  In Al,Dx
  481.  Mov Dx,3C0h
  482.  Mov Al,30h
  483.  Out Dx,Al
  484.  Mov Al,2Ch
  485.  Out Dx,Al
  486. End;
  487.  
  488. Procedure SetView(X,Y:Word);
  489. Var PelPos:Byte;
  490. Begin
  491.  PelPos:=StartDat[X Mod 9];
  492.  X:=(X Div 9)+(Y Div 16)*160;
  493.   Asm
  494.     Mov Dx,3D4h    { Set Screen offset in bytes:}
  495.     Mov Bx,X
  496.     Mov Ah,Bh
  497.     Mov Al,0Ch
  498.     Out Dx,Ax
  499.     Mov Ah,Bl
  500.     Inc Al
  501.     Out Dx,Ax
  502.  
  503.     Mov Al,8       { Set Y-Offset within Character-Row: }
  504.     Mov Bx,Y
  505.     And Bl,15
  506.     Mov Ah,Bl
  507.     Out Dx,Ax
  508.  
  509.     Mov Dx,3C0h    { Set X-Offset within Character-Column: }
  510.     Mov Al,33h
  511.     Out Dx,Al
  512.     Mov Al,PelPos
  513.     Out Dx,Al
  514.  End;
  515. End;
  516.  
  517. Procedure UpDateScroller;
  518. Begin
  519.  If ScrollOfs=9 then
  520.   Begin
  521.    ScrollOfs:=0;
  522.  
  523.    Move(Mem[$B800:14*320+2],Mem[$B800:14*320],3*320-2);
  524.    Inc(CharOfs);
  525.    If CharOfs=4 then
  526.     Begin
  527.      Inc(ScrollPos);
  528.      WriteBigMessage(84-CharOfs,15,14,ScrollMessage[ScrollPos]);
  529.      If ScrollPos=Length(ScrollMessage) Then ScrollPos:=0;
  530.      CharOfs:=0;
  531.     End;
  532.   End
  533.  else
  534.   Inc(ScrollOfs,9);
  535.  SetHorizOfs(ScrollOfs);
  536. End;
  537.  
  538.  
  539.  
  540. Begin
  541.  CursorOff;
  542.  FillChar(Mem[$B800:0000],4000,0);
  543.  
  544.   With MoveMes do
  545.    Begin
  546.     YPos:=110;
  547.     YSpeed:=2;
  548.     XPos:=40*8;
  549.     XSpeed:=3;
  550.     Counter:=0;
  551.    End;
  552.  
  553.   With MoveSplit Do
  554.    Begin
  555.     YPos:=295;
  556.     YSpeed:=2;
  557.    End;
  558.  
  559.  DoubleWidth;
  560.  SetPelReset;
  561.  ScrollText(MoveMes.YPos);
  562.  Split(MoveSplit.YPos);
  563.  Setupbars;
  564.  MakePal;
  565.  SetCharSet;
  566.  Sync;
  567.  CenterWrite(1,14,#194'─────────────────────────────────────────────────────────────────────────────'#190);
  568.  WriteBigMessage(1,2,4,'GAME - Gotta Get it!');
  569.  CenterWrite(5,14,#194'─────────────────────────────────────────────────────────────────────────────'#190);
  570.  
  571.   Repeat
  572.     With MoveMes do
  573.      Begin
  574.        If (YPos>80) and (YPos<200) then
  575.         Inc(YPos,YSpeed)
  576.        else
  577.         Begin
  578.          YSpeed:=-YSpeed;
  579.          YPos:=YPos+YSpeed;
  580.         End;
  581.       Counter:=1-Counter;
  582.        If Odd(Counter) then
  583.         Begin
  584.          If (XPos<40*8) or (XPos>40*8+150) then XSpeed:=-XSpeed;
  585.          Inc(XPos,XSpeed);
  586.         End;
  587.      End;
  588.  
  589.     With MoveSplit do
  590.      Begin
  591.        If (YPos>290) and (YPos<325) then
  592.         Inc(YPos,YSpeed)
  593.        else
  594.         Begin
  595.          YSpeed:=-YSpeed;
  596.          YPos:=YPos+YSpeed;
  597.         End;
  598.      End;
  599.  
  600.    UpdateBars;
  601.    ScrollText(MoveMes.YPos);
  602.    UpDateScroller;
  603.    Split(MoveSplit.YPos);
  604.    ColorBars;
  605.   Until KeyPressed;
  606.  
  607.   While KeyPressed do Readkey;
  608.  Split(400);
  609.  SetView(0,0);
  610.  ScrollText(0);
  611.   Asm
  612.    Mov Ax,3
  613.    Int 10h
  614.   End;
  615.  FastWrite(1,1,15,'Bye from World of Wonders!');
  616.  Writeln;
  617.  CursorOn;
  618. End.
  619.